<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .div1{
            width: 300px;
            height: 100px;
            position: relative;
            background: red;
            overflow: hidden;
        }
        .div1:after{
            content: "";
            display: block;
            position: absolute;
            background: yellow;
            padding: 0px 600px 200px 0px;
            opacity: 0;
            transition: 1s;
        }
        .div1:active:after{
            padding: 0px;
            opacity: 1;
            transition: 0s;
        }
    </style>
</head>
<body>
<div class="div1"></div>
</body>
</html>